﻿namespace KinonekoSoftware.Studio.Pages.Instances
{
    /// <summary>
    /// ModulePresenter 到 Feature的消息
    /// </summary>
    public abstract class ModuleMSG : MessageCore
    {
        
    }
    
    public sealed class RemoveModuleMessage : ModuleMSG
    {
        public required ModulePresenter Block         { get; init; }
    }
    
    public sealed class NumericStyleChangedMessage: ModuleMSG
    {
        public required NumericGroupPresenterBase OldBlock { get; init; }
        public required NumericStyle              Style    { get; init; }
        public          NumericGroupPresenterBase NewBlock { get; set; }
    }
    
    public sealed class SaveModuleMessage : ModuleMSG
    {
    }

    

    public sealed class ValueChangedMSG : ModuleMSG
    {
        public required ModulePresenter Block      { get; init; }
        public required ModulePresenter Element    { get; init; }
        public required string          Metadata { get; init; }
    }
    
    public sealed class MetadataChangedMSG : ModuleMSG
    {
        public required ModulePresenter Block     { get; init; }
        public required ModulePresenter Element   { get; init; }
        public required string          OldSpell  { get; init; }
        public required string          NewSpell  { get; init; }
        public required bool            IsRemoved { get; init; }
    }

    /// <summary>
    /// ShiftUp、ShiftDown的时候发送的消息
    /// </summary>
    public sealed class PositionChangedMessage : ModuleMSG
    {
        public required ModulePresenter Block         { get; init; }
        public required bool            IsUpDirection { get; init; }
    }
}